package net.techwatch.spring.roo.domain;

import javax.persistence.Entity;
import org.springframework.roo.addon.entity.RooEntity;
import org.springframework.roo.addon.javabean.RooJavaBean;
import org.springframework.roo.addon.tostring.RooToString;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.util.Date;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import java.util.Set;
import java.util.HashSet;
import javax.persistence.OneToMany;
import javax.persistence.CascadeType;

@Entity
@RooEntity
@RooJavaBean
@RooToString
public class EmployeeList {

    @NotNull
    private String name;

    @Size(max = 254)
    private String comment;

    @Temporal(TemporalType.TIMESTAMP)
    private Date createDate;

    @OneToMany(cascade = CascadeType.ALL)
    private Set<Employee> employee = new HashSet<Employee>();
}
